<style>
    .layui-form-label {
        width: 100px;
    }

    .layui-input-block {
        margin-left: 130px;
    }
</style>
<div class="rightcontent rc-bg-grey">
    <div class="rc-pagepadding ">
        <div class=" rc-pannel layui-form">
            <div class=" rc-pannel-header rc-pagepadding rc-bold">
                <i class="iconfont goback rc-pointer">&#xe62b;</i> 添加信息资料表
            </div>
            <div class="rc-pannel-body  rc-pagepadding">


                <div class="layui-form-item">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" lay-verify="required" class="layui-input" placeholder="显示名称">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">表名</label>
                    <div class="layui-input-block">

                        <div class="layui-input-group" style="width: 100%;">
                            <div class="layui-input-split layui-input-prefix" style="width:100px" id="tablepretitle">
                                <?php echo getDatabasePrefix() ?>frame_user_
                                <input type="hidden" name="tablepre" id="tablepre" placeholder="输入表名" value="frame_user_" class="layui-input" />
                            </div>
                            <input type="text" name="name" placeholder="输入表名" class="layui-input">

                        </div>


                    </div>
                </div>



                <div class="layui-form-item">
                    <label class="layui-form-label">多行记录</label>
                    <div class="layui-input-block">
                        <input type="radio" name="multiline" value="1" lay-verify="required" class="layui-input" title="是">
                        <input type="radio" name="multiline" value="0" lay-verify="required" class="layui-input" title="否" checked>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">完善资料填写</label>
                    <div class="layui-input-block">
                        <input type="radio" name="improve" value="1" lay-verify="required" class="layui-input" title="是" checked>
                        <input type="radio" name="improve" value="0" lay-verify="required" class="layui-input" title="否">
                    </div>
                </div>

                <div class="layui-form-item rc-margin-bottom0">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit lay-filter="submit">提交</button>
                        <button type="reset" class="layui-btn layui-btn-sm">重置</button>
                    </div>
                </div>

            </div>



        </div>

    </div>
</div>

<script>
    layui.use(function() {

        var form = layui.form;
        form.on('submit(submit)', function(data) {
            $.ajax({
                url: '/admin/cnf/UserModel/addInfoTable', //请求路径
                type: "POST", //请求方式
                data: data.field, // 默认写法
                success: function(data) {
                    if (data.code == 0) {
                        toastr_success("添加成功", function() {
                            window.location.href = "/admin/cnf/UserModel/infoTable";
                        });
                    } else {
                        toastr_error(data.message);
                    }
                },
                error: function() {

                },

            });
        });




    });
</script>